﻿<dxg:GridControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
    xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
    xmlns:lunac="clr-namespace:Luna.UI.Converters"
    xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
    xmlns:lbe="clr-namespace:Loki.UI.Wpf.Behaviours;assembly=Loki.UI.Wpf"
    xmlns:lco="clr-namespace:Loki.Commands;assembly=Loki.Core"
    x:Class="Luna.UI.Crm.EntityListView"
    mc:Ignorable="d"             d:DesignHeight="688" d:DesignWidth="1151"
    AutoGenerateColumns="None"
    EnableSmartColumnsGeneration="True"
    ItemsSource="{Binding Entities}" SelectionMode="Cell">
    <i:Interaction.Behaviors>
        <lbe:TableViewRowDoubleClickBehavior Command="{x:Static lco:ApplicationCommands.Open}" />
    </i:Interaction.Behaviors>
    <dxg:GridControl.Resources>
        <lunac:PhoneNumberConverter x:Key="PhoneConverter" />
    </dxg:GridControl.Resources>
    <dxg:GridControl.Bands>
        <dxg:GridControlBand Header="Nom" Fixed="Left">
            <dxg:GridColumn FieldName="FullName" Header="Nom" />
            <dxg:GridColumn FieldName="Company" Header="Société" />
        </dxg:GridControlBand>
        <dxg:GridControlBand Header="Contact">
            <dxg:GridColumn FieldName="Mail"  Header="Mail" />
            <dxg:GridColumn FieldName="Phone" Header="Tél">
                <dxg:GridColumn.EditSettings>
                    <dxe:TextEditSettings DisplayTextConverter="{StaticResource PhoneConverter}" />
                </dxg:GridColumn.EditSettings>
            </dxg:GridColumn>
            <dxg:GridColumn FieldName="Mobile" Header="Tél-portable">
                <dxg:GridColumn.EditSettings>
                    <dxe:TextEditSettings DisplayTextConverter="{StaticResource PhoneConverter}" />
                </dxg:GridColumn.EditSettings>
            </dxg:GridColumn>
            <dxg:GridColumn FieldName="Fax" Header="Fax">
                <dxg:GridColumn.EditSettings>
                    <dxe:TextEditSettings DisplayTextConverter="{StaticResource PhoneConverter}" />
                </dxg:GridColumn.EditSettings>
            </dxg:GridColumn>
        </dxg:GridControlBand>
        <dxg:GridControlBand Header="Adresse" Visible="False">
            <dxg:GridColumn FieldName="Adress" Header="Adresse" />
            <dxg:GridColumn FieldName="ZipCode" Header="Code postal" />
            <dxg:GridColumn FieldName="City" Header="Ville" />
            <dxg:GridColumn FieldName="Country" Header="Pays" />
        </dxg:GridControlBand>
        <dxg:GridControlBand Header="Web" Visible="False">
            <dxg:GridColumn FieldName="Url" Header="Site web" />
            <dxg:GridColumn FieldName="Skype" Header="Adresse" />
            <dxg:GridColumn FieldName="Twitter" Header="Adresse" />
        </dxg:GridControlBand>
        <dxg:GridControlBand Header="Informations" Visible="True">
            <dxg:GridColumn FieldName="Manager" Header="Géré par" />
            <dxg:GridColumn FieldName="Source" Header="Source" />
            <dxg:GridColumn FieldName="Sector" Header="Secteur" />
        </dxg:GridControlBand>
    </dxg:GridControl.Bands>
    <dxg:GridControl.View>
        <dxg:TableView ShowTotalSummary="True" AllowEditing="False" AutoWidth="False" ScrollingMode="Smart" HorizontalScrollbarVisibility="Auto" />
    </dxg:GridControl.View>
</dxg:GridControl>